package com.aioething.iot.beans;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;

@Data
public class MqttMessage {
    @JSONField(name = "payload_encoding")
    private String payloadEncoding = "plain";
    private String topic;
    private Integer qos = 0;
    @JSONField(name = "clientid")
    private String clientId;
    private String payload;
    private Boolean retain = Boolean.FALSE;
    private Properties properties = new Properties();

    @Data
    public static class Properties {
        @JSONField(name = "payload_format_indicator")
        private Integer payloadFormatIndicator = 0;
        @JSONField(name = "message_expiry_interval")
        private Integer messageExpiryInterval = 0;
        @JSONField(name = "response_topic")
        private String responseTopic = "";
        @JSONField(name = "correlation_data")
        private String correlationData = "";
        @JSONField(name = "content_type")
        private String contentType = "text/plain";
    }
}
